import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class PopupService {

  private wrap:any;
  constructor() { }

  openPopup(param:any){
    //alert(param.data);
    console.log(this.wrap);
    if(!this.wrap){
      this.wrap=document.createElement("div");
      this.wrap.innerHTML="<div class='popup-box'><div class='popup'>"+param.data+"</div></div>";
      let first=document.body.firstChild;
      let wraphtml=document.body.insertBefore(this.wrap,first);
    }else{

    }
    
  }
}
